<?php
/**
 * @copyright   Copyright (c) 2017 https://www.sapixx.com All rights reserved.
 * @license     Licensed (http://www.apache.org/licenses/LICENSE-2.0).
 * @author      pillar<ltmn@qq.com>
 * 商品分类
 */
namespace app\bestbao\validate;
use think\Validate;

class Card extends Validate{

    protected $rule = [
        'token'     => 'require|max:25|token',
        'id'        => 'require|number',
        'title'     => 'require',
        'content'   => 'require',
        'picture'   => 'require',
        'logo'      => 'require',
        'phone'     => 'require',
        'email'     => 'require',
        'address'   => 'require',
        'longitude' => 'require',
        'latitude'  => 'require',
        'sort'      => 'require',
        'note'      => 'require',
    ];

    protected $message = [
        'id'        => 'ID丢失',
        'title'     => '名称或标题必须填写',
        'note'      => '描述必须填写',
        'content'   => '内容必须填写',
        'picture'   => '图片必须选择',
        'logo'      => 'Logo必须上传',
        'phone'     => '公司电话必须填写',
        'email'     => '公司邮箱必须填写',
        'address'   => '公司地址必须填写',
        'longitude' => '经纬度丢失',
        'latitude'  => '经纬度丢失',
        'sort'      => '序号必须填写',
    ];

    protected $scene = [
        'edit'            => ['title', 'content', 'logo', 'phone', 'email', 'address', 'longitude', 'latitude'],
        'informationEdit' => ['title','note','picture', 'content'],
        'sort'            => ['id', 'sort']
    ];
}